package cn.hniu.service.Impl;

import cn.hniu.mapper.TopicsMapper;
import cn.hniu.pojo.Topics;
import cn.hniu.service.TopicsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TopicsServiceImpl implements TopicsService {

    @Autowired
    private TopicsMapper topicsMapper;

    @Override
    public Integer addTopics(Topics topics) {
        return topicsMapper.insert(topics);
    }

    @Override
    public List<Topics> findTopics(String data, Integer begin, Integer size) {
        return topicsMapper.findTopics(data,begin,size);
    }

    @Override
    public Integer updateTopics(Topics topics) {
        return topicsMapper.updateById(topics);
    }

    @Override
    public Integer deleteTopics(Integer id) {
        return topicsMapper.deleteById(id);
    }

    @Override
    public List<Topics> findTopicsBytHot(Integer data, Integer begin, Integer size) {
        return null;
    }

    @Override
    public Integer updateTopicsBytHot(Topics topics) {
        return topicsMapper.updateById(topics);
    }

    @Override
    public List<Topics> findTopicsByRank() {
        return topicsMapper.findTopicsByRank();
    }
}
